@(proname:String)(implicit session: Session)
@background.main("导入数据（SE）",proname) {

  <style>
          label {
            text-indent: 2em;
          }

  </style>


  <div class="page-bar">
    <ul class="page-breadcrumb">
      <li>
        <a href="#">
          <i class='fa fa-cloud-upload'></i>
          数据导入（SE）
        </a>
      </li>
    </ul>
  </div>

  <div class="row-fluid">

    <div class="row">
      <div class="col-md-12 col-sm-12">
        <div class="portlet blue-soft box">

          <div class="portlet-title">
            <div class="caption">
              转录组（SE）原始数据质控、比对参数设置界面
            </div>
          </div>

          <div class="portlet-body">

            <form class="registration-form form-horizontal" id="UpdateForm" method="get"
            accept-charset="UTF-8">

              <div class="form-group" style="display: none;">
                <div class="col-sm-4 indent">
                  <input name="proname" id="proname" class="form-control" value="@proname" />
                </div>
              </div>

              <div class="form-group">
                <label class="col-sm-12">样品名:</label>
                <div class="col-sm-4 indent">
                  <input name="sample" id="sample" class="form-control" />
                </div>
              </div>

              <div class="form-group">
                <label class="col-sm-12">fastq 文件:</label>
                <div class="col-sm-4 indent">
                  <input id="input-1" type="file" class="file" name="file" data-show-preview="false"
                  data-show-upload="false" accept=".fq,.fastq,.gz" >
                </div>
              </div>


              <div class="form-group">
                <label class="col-sm-12">
                  Input FASTQ quality file scores encoding type:</label>
                <div class="col-sm-4 indent">
                  <select class="form-control" name="encondingType">
                    <option value="-phred64">Illumina 1.3-1.7 Phred+64</option>
                    <option value="-phred33" selected>Illumina 1.8+ Phred+33</option>
                  </select>
                </div>
              </div>


              <div class="form-group">
                <label class="col-sm-4">Trimmomatic SE(single-end)(质控参数设置):
                  <a onclick="openHelp()"  title="帮助文档" class="helpIcon">
                    <i class="fa fa-question-circle-o"></i></a>
                </label>
                <div class="col-sm-1">
                  <a id="down-1" style="margin-left: 2em">
                    <i class="fa fa-arrow-down"></i>
                  </a>
                  <a id="up-1" style="margin-left: 2em;
                    display: none">
                    <i class="fa fa-arrow-up"></i>
                  </a>
                </div>
              </div>

              <div id="set-1" style="display: none" class="indent">

                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Perform initial ILLUMINACLIP step?:</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="stepMethod" onchange="stepChange(this)">
                        <option value="yes" selected>Yes</option>
                        <option value="no">No</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="stepValue">
                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">Adapter sequences to use:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="adapter">
                          <option value="TruSeq2-SE.fa">
                            TruSeq2 (single-ended, for Illumina GAII)</option>
                          <option value="TruSeq3-SE.fa" selected>
                            TruSeq3 (single-ended, for MiSeq and HiSeq)</option>
                        </select>
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Maximum mismatch count which will still allow a full match to be performed:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="seed_mismatches" id="seed_mismatches" class="form-control" value="2" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      How accurate the match between the two 'adapter ligated' reads must be for PE palin
                      drome read alignment:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="palindrome_clip_threshold" id="palindrome_clip_threshold" class="form-control" value="30" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      How accurate the match between any adapter etc. sequence must be against a read:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="simple_clip_threshold" id="simple_clip_threshold" class="form-control" value="10" />
                      </div>
                    </div>
                  </div>
                </div>

                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Perform Sliding window trimming (SLIDINGWINDOW)?:</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="trimMethod" onchange="trimChange(this)">
                        <option value="yes" selected>Yes</option>
                        <option value="no">No</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="trimValue">
                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Number of bases to average across:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="window_size" id="window_size" class="form-control" value="20" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Average quality required:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="required_quality" id="required_quality" class="form-control" value="20" />
                      </div>
                    </div>
                  </div>
                </div>

                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Drop reads below a specified length (MINLEN)?:</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="minlenMethod" onchange="minlenChange(this)">
                        <option value="yes" selected>Yes</option>
                        <option value="no">No</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="minlenValue">
                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Minimum length of reads to be kept:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="minlen" id="minlen" class="form-control" value="35" />
                      </div>
                    </div>
                  </div>
                </div>

                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Cut bases off the start of a read, if below a threshold quality (LEADING)?:</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="leadingMethod" onchange="leadingChange(this)">
                        <option value="yes">Yes</option>
                        <option value="no" selected>No</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="leadingValue" style="display: none">
                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Minimum quality required to keep a base:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="leading" id="leading" class="form-control" value="3" />
                      </div>
                    </div>
                  </div>
                </div>

                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Cut bases off the end of a read, if below a threshold quality (TRAILING)?:</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="trailingMethod" onchange="trailingChange(this)">
                        <option value="yes" selected>Yes</option>
                        <option value="no">No</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="trailingValue">
                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Minimum quality required to keep a base:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="trailing" id="trailing" class="form-control" value="20" />
                      </div>
                    </div>
                  </div>
                </div>

                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Cut the read to a specified length (CROP):</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="cropMethod" onchange="cropChange(this)">
                        <option value="yes">Yes</option>
                        <option value="no" selected>No</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="cropValue" style="display: none">
                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Number of bases to keep from the start of the read:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="crop" id="crop" class="form-control" value="0" />
                      </div>
                    </div>
                  </div>

                </div>

                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Cut the specified number of bases from the start of the read (HEADCROP)?:</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="headcropMethod" onchange="headcropChange(this)">
                        <option value="yes">Yes</option>
                        <option value="no" selected>No</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="headcropValue" style="display: none">
                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Number of bases to remove from the start of the read:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="headcrop" id="headcrop" class="form-control" value="0" />
                      </div>
                    </div>
                  </div>
                </div>
              </div>

              <div class="form-group">
                <label class="col-sm-4">HISAT2 A fast and sensitive alignment program(比对参数设置):
                  <a onclick="openHelp2()"  title="帮助文档" class="helpIcon">
                    <i class="fa fa-question-circle-o"></i></a></label>
                <div class="col-sm-1">
                  <a id="down-2" style="margin-left: 2em">
                    <i class="fa fa-arrow-down"></i>
                  </a>
                  <a id="up-2" style="margin-left: 2em;
                    display: none">
                    <i class="fa fa-arrow-up"></i>
                  </a>
                </div>
              </div>

              <div id="set-2" style="display: none" class="indent">

                <div class="form-group" style="display: none;">
                  <p class="col-sm-5" style="text-indent: 1em;display: none;">
                    Specify strand-specific information:</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="rna_strandness">
                        <option value="None" selected="true">Unstranded</option>
                        <option value="FR">FR</option>
                        <option value="RF">RF</option>
                      </select>
                    </div>
                  </div>
                </div>


                <div class="form-group" style="display: none;">
                  <p class="col-sm-5" style="text-indent: 1em;">Paired-end options:</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="paired_end_options_selector" onchange="pairedChange(this)">
                        <option value="defaults" selected>Use default values</option>
                        <option value="advanced">Specify paired-end parameters</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="pairedValue" style="display: none;">

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Minimum fragment length:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="minins" id="minins" class="form-control" value="0" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Maximum fragment length:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="maxins" id="maxins" class="form-control" value="500" />
                      </div>
                    </div>
                  </div>


                  <div class="form-group">
                    <p class="col-sm-5 indent-1">
                      Disable alignments of individual mates? i.e. Suppress unpaired alignments for paired reads?</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="no_mixed">
                          <option value="--no-mixed">Yes</option>
                          <option value=" " selected>No</option>
                        </select>
                      </div>
                    </div>
                  </div>

                  <div class="form-group">
                    <p class="col-sm-5 indent-1">
                      Disable discordant alignments? i.e. Suppress discordant alignments for paired reads?</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="no_discordant">
                          <option value="--no-discordant">Yes</option>
                          <option value=" " selected>No</option>
                        </select>
                      </div>
                    </div>
                  </div>

                </div>


                <div class="form-group" style="display: none;">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Use GTF file with known splice sites?</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="gtf">
                        <option value="yes" selected>Yes</option>
                        <option value="no">No</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Reporting</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="report_type" onchange="reportChange(this)">
                        <option value="defaults">
                          look for multiple alignments, report best, with MAPQ</option>
                        <option value="advanced">
                          report up to K alns per read; MAPQ not meaningful</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="reportValue" style="display: none">
                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      K Primary alignments number for each read:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="max_primary" id="max_primary" class="form-control" value="5" />
                      </div>
                    </div>
                  </div>
                </div>


                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Alignment options</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="alignment_options_selector" onchange="alignChange(this)">
                        <option value="defaults" selected>Use default values</option>
                        <option value="advanced">Specify alignment parameters</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="alignValue" style="display: none;">

                  <div class="form-group">
                    <p class="col-sm-5 indent-1">
                      Function type</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="function_type">
                          <option value="C">Constant</option>
                          <option value="L" selected="true">Linear [f(x) = y + z * x]</option>
                          <option value="S">Square root [f(x) = y + z * x^2]</option>
                          <option value="G">Natural logarithm [f(x) = y + z * log(x)]</option>
                        </select>
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Constant term (y):</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="constant_term" id="constant_term" class="form-control" value="0" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Coefficient (z):</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="coefficient" id="coefficient" class="form-control" value="0.15" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group">
                    <p class="col-sm-5 indent-1">
                      Ignore quality values? i.e. Treat all quality values as 30 on Phred scale?</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="ignore_quals">
                          <option value="--ignore-quals">Yes</option>
                          <option value="" selected>No</option>
                        </select>
                      </div>
                    </div>
                  </div>

                  <div class="form-group">
                    <p class="col-sm-5 indent-1">
                      Skip forward strand of reference? i.e. Do not align forward (original) version of read?</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="skip_forward">
                          <option value="--nofw">Yes</option>
                          <option value=" " selected>No</option>
                        </select>
                      </div>
                    </div>
                  </div>

                  <div class="form-group">
                    <p class="col-sm-5 indent-1">
                      Skip reverse strand of reference? i.e. Do not align reverse-complement version of read?</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="skip_reverse">
                          <option value="--norc">Yes</option>
                          <option value=" " selected>No</option>
                        </select>
                      </div>
                    </div>
                  </div>

                </div>


                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Input options</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="input_options_selector" onchange="inputChange(this)">
                        <option value="defaults" selected>Use default values</option>
                        <option value="advanced">Specify alignment parameters</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="inputValue" style="display: none;">


                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Skip the first N reads or pairs in the input:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="skip" id="skip" class="form-control" value="0" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Stop after aligning N reads:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="stop_after" id="stop_after" class="form-control" value="0" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Trim 5:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="trim_five" id="trim_five" class="form-control" value="0" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Trim 3:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="trim_three" id="trim_three" class="form-control" value="0" />
                      </div>
                    </div>
                  </div>

                </div>


                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Scoring options</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="scoring_options_selector" onchange="scoreChange(this)">
                        <option value="defaults" selected>Use default values</option>
                        <option value="advanced">Specify scoring parameters</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="scoreValue" style="display: none;">

                  <div class="form-group">
                    <p class="col-sm-5 indent-1">
                      Function type</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="score_function_type">
                          <option value="C">Constant</option>
                          <option value="L" selected="true">Linear [f(x) = y + z * x]</option>
                          <option value="S">Square root [f(x) = y + z * x^2]</option>
                          <option value="G">Natural logarithm [f(x) = y + z * log(x)]</option>
                        </select>
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Constant term (y):</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="score_constant_term" id="score_constant_term" class="form-control" value="0" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Coefficient (z):</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="score_coefficient" id="score_coefficient" class="form-control" value="-0.2" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Set match bonus:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="match_bonus" id="match_bonus" class="form-control" value="2" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Maximum mismatch penalty, lower qual = lower penalty:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="max_mismatch" id="max_mismatch" class="form-control" value="6" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Minimum mismatch penalty, lower qual = lower penalty:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="min_mismatch" id="min_mismatch" class="form-control" value="2" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Ambiguous read penalty:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="ambiguous_penalty" id="ambiguous_penalty" class="form-control" value="1" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Maximum soft-clipping penalty, lower qual = lower penalty:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="soft_clip_penalty_max" id="soft_clip_penalty_max" class="form-control" value="2" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Minimum soft-clipping penalty, lower qual = lower penalty:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="soft_clip_penalty_min" id="soft_clip_penalty_min" class="form-control" value="1" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Read gap open penalty:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="read_open_penalty" id="read_open_penalty" class="form-control" value="5" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Read gap extend penalty:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="read_extend_penalty" id="read_extend_penalty" class="form-control" value="3" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Reference gap open penalty:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="ref_open_penalty" id="ref_open_penalty" class="form-control" value="5" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Reference gap extend penalty:</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="ref_extend_penalty" id="ref_extend_penalty" class="form-control" value="3" />
                      </div>
                    </div>
                  </div>

                </div>


                <div class="form-group">
                  <p class="col-sm-5" style="text-indent: 1em;">
                    Spliced alignment parameters</p>
                  <div class="col-sm-12 indent-3">
                    <div class="col-sm-4">
                      <select class="form-control" name="spliced_options_selector" onchange="splicedChange(this)">
                        <option value="defaults" selected>Use default values</option>
                        <option value="advanced">Specify scoring parameters</option>
                      </select>
                    </div>
                  </div>
                </div>

                <div id="splicedValue" style="display: none;">

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Penalty for a canonical splice sites(e.g. GT/AG)</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="canonical_penalty" id="canonical_penalty" class="form-control" value="0" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Penalty for a non-canonical splice sites(e.g. non-GT/AG)</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="noncanonical_penalty" id="noncanonical_penalty" class="form-control" value="12" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group">
                    <p class="col-sm-5 indent-1">
                      Penalty for long introns with canonical splice sites</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="spliced_function_type">
                          <option value="C">Constant</option>
                          <option value="L" selected="true">Linear [f(x) = y + z * x]</option>
                          <option value="S">Square root [f(x) = y + z * x^2]</option>
                          <option value="G">Natural logarithm [f(x) = y + z * log(x)]</option>
                        </select>
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Constant term (y)</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="spliced_constant_term" id="spliced_constant_term" class="form-control" value="-8" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Coefficient (z)</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="spliced_coefficient" id="spliced_coefficient" class="form-control" value="1" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group">
                    <p class="col-sm-5 indent-1">
                      Penalty for long introns with noncanonical splice sites</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="nc_function_type">
                          <option value="C">Constant</option>
                          <option value="L" selected="true">Linear [f(x) = y + z * x]</option>
                          <option value="S">Square root [f(x) = y + z * x^2]</option>
                          <option value="G">Natural logarithm [f(x) = y + z * log(x)]</option>
                        </select>
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Constant term (y)</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="nc_constant_term" id="nc_constant_term" class="form-control" value="-8" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Coefficient (z)</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="nc_coefficient" id="nc_coefficient" class="form-control" value="1" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Minimum intron length</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="min_intron" id="min_intron" class="form-control" value="20" />
                      </div>
                    </div>
                  </div>

                  <div class="form-group" >
                    <p class="col-sm-5 indent-1">
                      Maximum intron length</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <input name="max_intron" id="max_intron" class="form-control" value="50000" />
                      </div>
                    </div>
                  </div>


                  <div class="form-group">
                    <p class="col-sm-5 indent-1">
                      Disable spliced alignment</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="no_spliced_alignment">
                          <option value="--no-spliced-alignment">Yes</option>
                          <option value=" " selected>No</option>
                        </select>
                      </div>
                    </div>
                  </div>

                  <div class="form-group">
                    <p class="col-sm-5 indent-1">
                      Transcriptome assembly reporting</p>
                    <div class="col-sm-12 indent-1">
                      <div class="col-sm-4">
                        <select class="form-control" name="tma">
                          <option value=" ">Use default reporting.</option>
                          <option value="--dta-cufflinks" selected="true">
                            Report alignments tailored specifically for Cufflinks.</option>
                        </select>
                      </div>
                    </div>
                  </div>

                </div>

              </div>

              <div class="form-group">
                <div class = "actions indent col-sm-4">
                  <button type="button" class="btn btn-primary" style="width: 100%;" id="search" onclick="Running()">
                    应用</button>
                </div>
              </div>
            </form>


          </div>
        </div>
      </div>
    </div>
  </div>


  <div id="helpShow" class="modal fade modal-margin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 1000px;">
      <div class="modal-content">
        <div class="modal-header bg-primary">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
          <h4 class="modal-title">
            <span id="lblAddTitle" style="font-weight: bold">帮助文档：</span>
            <button type="button" class="btn-remove" data-dismiss="modal" ><i class="fa fa-remove"></i></button>
          </h4>
        </div>
        <div class="modal-body">
          <div class="row-fluid" id="logInfo">
            <p class="helpClass">
              分析模块封装了Trimmomatic工具，Trimmomatic是一个针对Illumina高通量测序的reads trim工具，支持paired-end（双末端）和single-end（单末端）数据。</p>

            <p class="helpClass">Trimmomatic包括如下功能：</p>

            <p class="helpClass"><strong>ILLUMINACLIP:</strong>
              Cut adapter and other illumina-specific sequences from the read</p>

            <p class="helpClass"><strong>SLIDINGWINDOW:</strong>
              Perform a sliding window trimming, cutting once the average quality within the window falls below a threshold</p>

            <p class="helpClass"><STRONG>MINLEN:</STRONG> Drop the read if it is below a specified length</p>

            <p class="helpClass"><strong>LEADING:</strong>
              Cut bases off the start of a read, if below a threshold quality</p>

            <p class="helpClass"><strong>TRAILING:</strong>
              Cut bases off the end of a read, if below a threshold quality</p>

            <p class="helpClass"><strong>CROP:</strong> Cut the read to a specified length</p>

            <p class="helpClass"><strong>HEADCROP:</strong>
              Cut the specified number of bases from the start of the read</p>
            <br>
            <p class="helpClass">输入</p>
            <br>
            <p class="helpClass">对于single-end（单末端）数据，输入单个FASTQ文件。</p>

            <p class="helpClass">对于paired-end（双末端）数据，输入两个FASTQ文件（R1和R2）。</p>
            <br>
            <p class="helpClass">设置质量值参数， Illumina 1.3-1.7 Phred+64 对应Illumina早期平台，Illumina 1.8+ Phred+33 对应Illumina最新平台，默认参数为：Illumina 1.8+ Phred+33。</p>
            <br>
            <p class="helpClass">附录：</p>
            <br>
            <p class="helpClass">对于常规的RNA或DNA测序，HiSeq4000或HiSeqXTen平台，PE100或PE150，建议使用如下参数设置：</p>
            <p class="helpClass">Perform initial ILLUMINACLIP step：Yes</p>
            <p class="helpClass">Maximum mismatch count which will still allow a full match to be performed：2</p>
            <p class="helpClass">How accurate the match between the two 'adapter ligated' reads must be for PE palindrome read alignment：30</p>
            <p class="helpClass">How accurate the match between any adapter etc. sequence must be against a read：10</p>
            <p class="helpClass">Perform Sliding window trimming (SLIDINGWINDOW)：Yes</p>
            <p class="helpClass">Number of bases to average across：20</p>
            <p class="helpClass">Average quality required：20</p>
            <p class="helpClass">Drop reads below a specified length (MINLEN)：Yes</p>
            <p class="helpClass">Minimum length of reads to be kept：35</p>
            <p class="helpClass">Cut bases off the end of a read, if below a threshold quality (TRAILING)：Yes</p>
            <p class="helpClass">Minimum quality required to keep a base：20</p>
            <p class="helpClass">即，去接头污染，比对允许的最大错配数为2，palindrome模式下匹配碱基数阈值为30，simple模式下的匹配碱基数阈值为10。过滤read尾部质量值20以下的碱基，设置20bp的窗口，如果窗口内的平均质量值低于20，从窗口开始截去后端碱基，过滤质控后35bp以下的read。</p>
            <br>
            <p class="helpClass">分析模块引用了Trimmomatic v0.32 软件(
              <a target="_blank" href="http://www.usadellab.org/cms/index.php?page=trimmomatic">http://www.usadellab.org/cms/index.php?page=trimmomatic</a> )。</p>
            <br>
            <p class="helpClass">相关文献如下所示：</p>
            <p class="helpClass">Bolger, A.M., Lohse, M., &amp; Usadel, B. (2014). Trimmomatic: A flexible trimmer for Illumina Sequence Data. Bioinformatics, btu170.</p>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div id="helpShow2" class="modal fade modal-margin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 1000px;">
      <div class="modal-content">
        <div class="modal-header bg-primary">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
          <h4 class="modal-title">
            <span id="lblAddTitle" style="font-weight: bold">帮助文档：</span>
            <button type="button" class="btn-remove" data-dismiss="modal" ><i class="fa fa-remove"></i></button>
          </h4>
        </div>
        <div class="modal-body">
          <div class="row-fluid">
            <p class="helpClass">分析模块，输入测序数据与参考基因组进行比对，从而得到比对结果。这里，测序数据，已通过“Trimmomatic PE/SE”进行去接头污染和质量控制。</p>
            <p class="helpClass">HISAT2 属于Spliced Aligner，比对过程中，reads能够开gap跨越内含子，比对到两边的外显子上。比对完成后，生成排序后的bam比对结果文件。</p>
            <p class="helpClass">注： 排序后的bam文件，可下载，并利用IGV软件打开，查看比对结果。</p>
            <p class="helpClass">IGV安装和使用，包含Windows桌面版和iPad版，官方网站提供了详细的文档。参考网站：（
              <a target="_blank" href="http://www.broadinstitute.org/igv/">http://www.broadinstitute.org/igv/</a>）。</p>
            <br>

            <p class="helpClass">输出：</p>
            <br>
            <p class="helpClass">bam格式的比对结果文件。</p>
            <p class="helpClass">HISAT2 SAM/BAM格式说明，参考网站（
              <a href="http://ccb.jhu.edu/software/hisat2/manual.shtml#sam-output" target="_blank">http://ccb.jhu.edu/software/hisat2/manual.shtml#sam-output</a>
              ）。</p>
            <br>
            <p class="helpClass">分析模块引用了HISAT2-2.0.4软件（
              <a target="_blank" href="http://bowtie-bio.sourceforge.net/index.shtml">http://bowtie-bio.sourceforge.net/index.shtml</a>）。</p>
            <br>
            <p class="helpClass">相关文献如下所示：</p>
            <p class="helpClass"> Kim D, Langmead B and Salzberg SL. HISAT: a fast spliced aligner with low memory requirements. Nature Methods 2015.</p>

          </div>
        </div>
      </div>
    </div>
  </div>

  <script>


          $(function () {
            formValidation();
          })

          function openHelp() {
            $("#helpShow").modal("show")
          }

          function openHelp2() {
            $("#helpShow2").modal("show")
          }


          function formValidation() {
            $('#UpdateForm').formValidation({
              framework: 'bootstrap',
              icon: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
              },
              fields: {
                sample: {
                  validators: {
                    notEmpty: {
                      message: '不能为空!'
                    },
                    regexp: {
                      regexp: '^[A-Za-z0-9"_"]{1,12}$',
                      message: '12个以内字符，可使用字母、数字、下划线！'
                    },
                    stringLength: {
                      message: '样品名长度最大为20！',
                      max: function (value, validator, $field) {
                        return 20 - (value.match(/\r/g) || []).length;
                      }
                    },
                    remote: {
                      type: 'POST',
                      url: '/project/checkSample?proname=@proname',
                      message:"样品名重复，请重新输入",
                      delay: 1000
                    },
                  }
                },
                file:{
                  validators: {
                    notEmpty: {
                      message: '请选择一个数据文件！'
                    },
                    file: {
                      extension: 'fq,gz,fastq',
                      message: '文件格式：fq,fq.gz,fastq,fastq.gz！'
                    }
                  }
                },
                seed_mismatches:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                palindrome_clip_threshold:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                simple_clip_threshold:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                window_size:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                required_quality:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                minlen:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                leading:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                trailing:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                crop:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                headcrop:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                m:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                M:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                x:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为数字！'
                    }
                  }
                },
                max_primary:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为数字！'
                    }
                  }
                },
                constant_term:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                coefficient:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                skip:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为数字！'
                    },
                    between: {
                      min: 0,
                      max: 9999999999999,
                      message: "最小值为0！"
                    }
                  }
                },
                stop_after:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为数字！'
                    },
                    between: {
                      min: 0,
                      max: 9999999999999,
                      message: "最小值为0！"
                    }
                  }
                },
                trim_five:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为数字！'
                    },
                    between: {
                      min: 0,
                      max: 9999999999999,
                      message: "最小值为0！"
                    }
                  }
                },
                trim_three:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为数字！'
                    },
                    between: {
                      min: 0,
                      max: 9999999999999,
                      message: "最小值为0！"
                    }
                  }
                },
                score_constant_term:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为数字！'
                    }
                  }
                },
                score_coefficient:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为数字！'
                    }
                  }
                },
                match_bonus:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                max_mismatch:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                min_mismatch:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                ambiguous_penalty:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                soft_clip_penalty_max:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                soft_clip_penalty_min:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                read_open_penalty:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                ref_extend_penalty:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                canonical_penalty:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                noncanonical_penalty:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                spliced_constant_term:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为数字！'
                    }
                  }
                },
                spliced_coefficient:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为整数！'
                    }
                  }
                },
                nc_constant_term:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为数字！'
                    }
                  }
                },
                nc_coefficient:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    numeric: {
                      message: '必须为整数！'
                    }
                  }
                },
                min_intron:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                },
                max_intron:{
                  validators: {
                    notEmpty: {
                      message: '不能为空！'
                    },
                    integer: {
                      message: '必须为整数！'
                    }
                  }
                }
              }
            })
          }


          $("#down-1").click(function () {
            $("#set-1").show();
            $("#down-1").hide();
            $("#up-1").show()
          });

          $("#up-1").click(function () {
            $("#set-1").hide();
            $("#down-1").show();
            $("#up-1").hide()
          });

          $("#down-2").click(function () {
            $("#set-2").show();
            $("#down-2").hide();
            $("#up-2").show()
          });

          $("#up-2").click(function () {
            $("#set-2").hide();
            $("#down-2").show();
            $("#up-2").hide()
          });

          function stepChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "yes") {
              $("#stepValue").show()
            } else {
              $("#stepValue").hide()
            }
          }

          function trimChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "yes") {
              $("#trimValue").show()
            } else {
              $("#trimValue").hide()
            }
          }

          function minlenChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "yes") {
              $("#minlenValue").show()
            } else {
              $("#minlenValue").hide()
            }
          }

          function leadingChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "yes") {
              $("#leadingValue").show()
            } else {
              $("#leadingValue").hide()
            }
          }

          function trailingChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "yes") {
              $("#trailingValue").show()
            } else {
              $("#trailingValue").hide()
            }
          }

          function cropChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "yes") {
              $("#cropValue").show()
            } else {
              $("#cropValue").hide()
            }
          }

          function headcropChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "yes") {
              $("#headcropValue").show()
            } else {
              $("#headcropValue").hide()
            }
          }

          function pairedChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "advanced") {
              $("#pairedValue").show()
            } else {
              $("#pairedValue").hide()
            }
          }

          function reportChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "advanced") {
              $("#reportValue").show()
            } else {
              $("#reportValue").hide()
            }
          }

          function alignChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "advanced") {
              $("#alignValue").show()
            } else {
              $("#alignValue").hide()
            }
          }

          function inputChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "advanced") {
              $("#inputValue").show()
            } else {
              $("#inputValue").hide()
            }
          }


          function scoreChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "advanced") {
              $("#scoreValue").show()
            } else {
              $("#scoreValue").hide()
            }
          }

          function splicedChange(element) {
            var value = $(element).find(">option:selected").val()
            if (value == "advanced") {
              $("#splicedValue").show()
            } else {
              $("#splicedValue").hide()
            }
          }

          var time = "";

          function Running() {
            var date = new Date();
            time = date.getTime();
            var form = $("#UpdateForm");
            var fv = form.data("formValidation")
            fv.validate()
            if (fv.isValid()) {
              var element = "<div id='content'><span id='info'>文件上传中： </span><span id='progress'></span></div>"
              var index = layer.msg(element, {
                icon: 16
                ,shade: 0.01,
                time: 20000000
              });
              var form = new FormData($("#UpdateForm")[0]);
              $.ajax({
                url: "@routes.SampleController.uploadSE()",
                type: "post",
                dataType: "json",
                processData: false,
                contentType: false,
                data: form,
                xhr: function(){ //获取ajaxSettings中的xhr对象，为它的upload属性绑定progress事件的处理函数

                  myXhr = $.ajaxSettings.xhr();
                  if(myXhr.upload){ //检查upload属性是否存在
                    //绑定progress事件的回调函数
                    myXhr.upload.addEventListener('progress',progressHandlingFunction, false);
                  }
                  return myXhr; //xhr对象返回给jQuery使用
                },
                success: function () {
                    window.location.replace("/parametron/sample/dataPage?proname=@proname")
                }
              });
            }
          }


          function progressHandlingFunction(e) {
            if (e.lengthComputable) {
              $('#progress').attr({value : e.loaded, max : e.total}); //更新数据到进度条
              var mydate = new Date();
              var time1 = mydate.getTime();
              var speed = (e.loaded/1024)/((time1-time)/1000)
              var percent = e.loaded/e.total*100;
              $('#progress').html(percent.toFixed(2) + "%   " + parseInt(speed) + "KB/S" );
              $('#progress').css('width', percent.toFixed(2) + "%");
            }
          }




          $("#input-1").fileinput({
            showPreview: false,
            browseLabel: "选择文件"
          });

          $("#input-2").fileinput({
            showPreview: false,
            browseLabel: "选择文件"
          });

  </script>
}